package com.ibm.db2oncampus.portal.menu.bean;

import java.io.Serializable;
import java.util.List;

import org.apache.myfaces.custom.navmenu.NavigationMenuItem;

import com.ibm.db2oncampus.portal.framework.beans.FacesBeanSupport;
import com.ibm.db2oncampus.portal.menu.domain.ConfiguracaoMenu;
import com.ibm.db2oncampus.portal.menu.service.MenuService;
import com.ibm.db2oncampus.portal.usuario.domain.Person;

/**
 * 
 * @author Wellington
 *
 */
public class MenuBean extends FacesBeanSupport implements Serializable {

	private MenuService menuService;
	private String iconeModulo;
	private String iconeFuncionalidade;
	
    public MenuBean() {}

    public List<NavigationMenuItem> getItensMenu() {
    	
    	Person loggedUser = getLoggedUser();
    	
    	ConfiguracaoMenu configuracao = new ConfiguracaoMenu(iconeModulo, iconeFuncionalidade);
        menuService.setConfiguracaoMenu(configuracao);
        return menuService.getItensMenu(loggedUser);
    }

    public String getIconeFuncionalidade() {
        return iconeFuncionalidade;
    }

    public void setIconeFuncionalidade(String iconeFuncionalidade) {
        this.iconeFuncionalidade = iconeFuncionalidade;
    }

    public String getIconeModulo() {
        return iconeModulo;
    }

    public void setIconeModulo(String iconeModulo) {
        this.iconeModulo = iconeModulo;
    }

	public MenuService getMenuService() {
		return menuService;
	}

	public void setMenuService(MenuService menuService) {
		this.menuService = menuService;
	}
}